﻿<!--项目管理-角色权限管理弹出视图	-->
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>成本管理-权限设置</title>
    <link href="~/Scripts/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-easyui/jquery.min.js"></script>
    <script src="~/Scripts/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Content/js/common.js"></script>
    <link href="~/Content/themes/table.css" rel="stylesheet" />
    <link href="~/Content/formstyles.css" rel="stylesheet" />
    <script type="text/javascript"></script>
</head>
<body>

    <script type="text/javascript">
        //全局参数
        //var ProjectID, ProjectNo, ProjectName;
        //var entryid, worktype, parttype, classtype, price, weight, cost, estcost,budCost,stdCost,plaCost;
        //var editIndex = undefined;
        //获取页面url参数
        //function getQueryParam(name) {
        //    var obj = $("#ui_pm_cost_dialog").dialog('options');
        //    var queryParams = obj["queryParams"];
        //    return queryParams[name];
        //}

 
        selectfieldName = function (record) { 
            //alert(record.value);
            //alert(record.text);
            $.ajax({
                url: "/PMCost/getFieldRoles?r=" + Math.random(),
                type: "get",
                data: {
                    fieldName: record.value,
                },
                dataType: "json",
                timeout: 5000,
                success: function (data) {
                    if (data.success) {
                        $('#comboxrole').combobox('setValues', data.msg);//"UserRoleId":"60,56,55"
                    } else {
                        $.show_alert("提示", data.msg);  
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    if (textStatus == "timeout") {
                        $.show_alert("提示", "请求超时，请刷新当前页重试！");
                    }
                    else {
                        $.show_alert("错误", textStatus + "：" + errorThrown);
                    }
                }
            });

           

        }
        //初始化控件
        $(function () { 
                      });
    </script> 
 
    <div style="padding: 15px; overflow: hidden">
        <form id="SetPmRoleForm" method="post" action="">
            <table class="tableForm" width="100%">
                <tr>
                    <th>
                        授权查看的字段：
                    </th>
                    <td>                     
                        <input id="fieldName" class="easyui-combobox" style="width:170px;height:22px;" data-options="
                                valueField:'value',
                                textField:'label',
                                onSelect:selectfieldName,
                                data: [{
                                    label: '预估成本',
                                    value: 'estCost'
                                },{
                                    label: '预算成本',
                                    value: 'budCost'
                                },{
                                    label: '标准成本',
                                    value: 'stdCost'
                                },{
                                    label: '实际成本',
                                    value: 'reaCost'
                                }]" />
                    </td>
                </tr>
                <tr>
                    <th>
                        授权查看的角色：
                    </th>
                    <td>
                        <input class="easyui-combobox" id="comboxrole" name="comboxrole" style="width:170px;height:22px;" data-options="url:'/User/GetAllRoleInfo',editable:false,valueField:'Id',textField:'RoleName',multiple:true" />
                        <img style="cursor: pointer; vertical-align: middle;" onclick="$('#comboxrole').combobox('clear');"
                             alt="清空角色" title="清空角色" src="../Content/themes/icon/edit-clear.png" />
                    </td>
                </tr>
            </table>
            <br>
            <div>提示：首先选择字段名，然后选择授权查看的角色，最后确认。</div> 
        </form>
    </div> 
</body>
</html>
